import 'package:camera/camera.dart';
import 'package:fish_redux/fish_redux.dart';
import 'package:multi_image_picker/multi_image_picker.dart';

enum CameraAction {
  action,
  init,
  onGallery,
  onTake,
  onDone,
  tmpPhoto,
  reject,
  save,
  onSave,
  select
}

class CameraActionCreator {
  static Action onAction() {
    return const Action(CameraAction.action);
  }

  static Action init(CameraDescription camera, CameraController controller) {
    return Action(CameraAction.init,
        payload: {'camera': camera, 'controller': controller});
  }

  static Action onGallery() {
    return const Action(CameraAction.onGallery);
  }

  static Action onTake() {
    return const Action(CameraAction.onTake);
  }

  static Action onDone() {
    return const Action(CameraAction.onDone);
  }

  static Action tmpPhoto(String path) {
    return Action(CameraAction.tmpPhoto, payload: path);
  }

  static Action reject() {
    return const Action(CameraAction.reject);
  }

  static Action onSave() {
    return const Action(CameraAction.onSave);
  }

  static Action save(String path) {
    return Action(CameraAction.save, payload: path);
  }

  static Action select(List<Asset> images) {
    return Action(CameraAction.select, payload: images);
  }
}
